﻿﻿@*单页模板*@
@*验收清单模板*@
@{
    Layout = null;
    var siteService = new SiteService();
    int siteId = UrlParams.SiteId;
    string siteName = UrlParams.SiteName;
    var currentSiteId = SiteContext.Current.SiteId;
    var currentSite = siteService.GetEntity(currentSiteId);
    var nodeService = new NodeService();
    var children = nodeService.GetChildren(3,siteId);
}
<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="renderer" content="webkit" />
    <title>节点列表 - 验收清单 - @siteName</title>
    <script src="https://code.jquery.com/jquery.min.js"></script>
</head>
<style>
    /*预置全局样式*/
    a,abbr,acronym,address,applet,article,aside,audio,b,blockquote,big,body,center,canvas,caption,cite,code,command,datalist,dd,del,details,dfn,dl,div,dt,em,embed,fieldset,figcaption,figure,font,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,keygen,label,legend,meter,nav,object,ol,output,p,pre,progress,q,s,samp,section,small,span,source,strike,strong,sub,sup,menu,tbody,tfoot,thead,th,tr,td,video,tt,u,ul,var{background:transparent;font-size:100%;margin:0;padding:0;border:0;outline:0;}
    body{color:#222;font-size:14px;line-height:1.42857143;font-family:"Microsoft YaHei"}
    a{color:#222;text-decoration:none;}
    a:hover{color:red;}
    a:active{ color:#c30}
    a:visited{ color:#333}
    ol,ul{list-style:none;vertical-align:middle;}
    .check-list{ margin:30px;}
    .check-list .hd{ margin-bottom:20px; text-align:center;}
    .check-list .hd h1.title{ margin-bottom:15px; font-size:30px; line-height:1.5;}
    .check-list .hd .property{ text-align:center;}
    .check-list .hd .property SPAN{ padding:0 5px;}
    .check-list .bd{ margin-bottom:20px; overflow:hidden;}
    .check-list .fd{ clear:both; border-top:1px solid #ddd; padding:20px 0; text-align:center;}
    .check-table{width: 100%; border-top:1px solid #000; border-left:1px solid #000; }
    .check-table tr{ position: relative;}
    .check-table tr.active{ background-color:#f5f5f5;}
    .check-table tr:hover{ background-color:#faf1f1;}
    .check-table tr th{ padding:9px; border-bottom:2px solid #000; border-right:1px solid #000; background-color:#f5f5f5;}
    .check-table tr td{ border-bottom:1px solid #000; border-right:1px solid #000; padding: 5px 10px; font-size: 12px; line-height: 20px;min-width:70px;word-break: break-all; white-space: pre-wrap;}
    .check-table tr td.nodeName,.check-table tr td.nodeType,.check-table tr td.nodeModel{ text-align:center;}
    .check-table tr td.linkUrl a{ display:block;}
</style>
<body>
    <div class="check-list">
        <div class="hd">
            <h1 class="title">
                <span> @siteName</span> - 验收清单检测目录
            </h1>
            <div class="property">
                <span class="date">日期：<script>var lastModified = document.lastModified;var lastDate = new Date(lastModified);var gy = lastDate.getFullYear();var gm = lastDate.getMonth()+1;var gd = lastDate.getDate();document.write(gy+"年"+gm+"月"+gd+"日")</script></span>
                <span class="num">检测节点：共计<b></b>个</span>
                <span id="openUrl"><a href="javascript:void(0)">(全部打开)</a></span>
            </div>
        </div>
        <div class="bd">
            <table class="check-table" border="0" cellpadding="0" cellspacing="0">
                <tr>
                    <th class="nodeName">一级节点</th>
                    <th class="nodeName">二级节点</th>
                    <th class="nodeName">三级节点</th>
                    <th class="linkUrl">检测地址</th>
                    <th class="nodeType">节点类型</th>
                    <th class="nodeModel">节点模型</th>
                    <th class="viewPath">首页模板</th>
                    <th class="viewPath">节点模板</th>
                    <th class="viewPath">内容模板</th>
                    <th class="viewPath">单页模板</th>
                </tr>
                @foreach (var child in children.Where(n => n.ShowOnMap))
                {
                    var chlidLink ="";
                    if( child.NodeType == NodeType.Link){
                        if(string.IsNullOrEmpty(child.LinkUrl)){
                            chlidLink = "空链接" ;
                        }
                        else if( child.LinkUrl.StartsWith("http") ){
                            chlidLink = "外链接" ;
                        }
                        else if( child.LinkUrl.Contains("SiteUrl:") ){
                            chlidLink = "<a target='_blank' href='"+ child.LinkUrl.ToUrl() +"'>"+ child.LinkUrl.ToUrl() +"</a>";
                        }else{
                            chlidLink = "<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + child.LinkUrl.ToUrl() +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + child.LinkUrl.ToUrl() +"</a>";
                        }
                    }
                    else{
                        chlidLink = "<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(child) +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(child) +"</a>";
                    }
                    <tr class="tr1" title="站点ID：@child.SiteId &#xD;节点ID：@child.NodeId &#xD;标识符：@child.Identifier &#xD;节点类型：@child.NodeType &#xD;节点模型：@child.MoldId &#xD;首页模板：@child.ListHomeViewPath &#xD;列表模板：@child.ListViewPath &#xD;内容模板：@child.ContentViewPath &#xD;单页模板：@child.SingleViewPath">
                        <td class="nodeName">@child.NodeName</td>
                        <td class="nodeName"></td>
                        <td class="nodeName"></td>
                        <td class="linkUrl">@Power.ToHtml(chlidLink)</td>
                        <td class="nodeType">@if(child.NodeType==0){<span>内容</span>}else if(child.NodeType==NodeType.Single){<span>单页</span>}else if(child.NodeType==NodeType.Link){<span>链接</span>}else if(child.NodeType==NodeType.Reference){<span>引用</span>}else{@child.NodeType}</td>
                        <td class="nodeModel">@if(child.MoldId==1){<span>文章</span>}else if(child.MoldId==2){<span>图片</span>}else if(child.MoldId==3){<span>视频</span>}else if(child.MoldId==4){<span>友情链接</span>}else if(child.MoldId==5){<span>领导信息</span>}else if(child.MoldId==6){<span>报告</span>}else{<span>@child.MoldId</span>}</td>
                        <td class="viewPath">@child.ListHomeViewPath</td>
                        <td class="viewPath">@child.ListViewPath</td>
                        <td class="viewPath">@child.ContentViewPath</td>
                        <td class="viewPath">@child.SingleViewPath</td>
                    </tr>
                    foreach (var childDepth1 in child.Children.Where(n => n.ShowOnMap))
                    {
                        var childDepth1Link ="";
                        if( childDepth1.NodeType == NodeType.Link){
                            if(string.IsNullOrEmpty(childDepth1.LinkUrl)){
                                childDepth1Link = "空链接" ;
                            }
                            else if( childDepth1.LinkUrl.StartsWith("http") ){
                                childDepth1Link = "外链接";
                            }
                            else if( childDepth1.LinkUrl.Contains("SiteUrl:") ){
                                childDepth1Link ="<a target='_blank' href='"+ childDepth1.LinkUrl.ToUrl() +"'>"+ childDepth1.LinkUrl.ToUrl() +"</a>";
                            }else{
                                childDepth1Link ="<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + childDepth1.LinkUrl.ToUrl() +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + childDepth1.LinkUrl.ToUrl() +"</a>";
                            }
                        }else{
                            childDepth1Link ="<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(childDepth1) +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(childDepth1) +"</a>";
                        }
                        <tr class="tr2" title="站点ID：@childDepth1.SiteId &#xD;节点ID：@childDepth1.NodeId &#xD;标识符：@childDepth1.Identifier &#xD;节点类型：@childDepth1.NodeType &#xD;节点模型：@childDepth1.MoldId &#xD;首页模板：@childDepth1.ListHomeViewPath &#xD;列表模板：@childDepth1.ListViewPath &#xD;内容模板：@childDepth1.ContentViewPath &#xD;单页模板：@childDepth1.SingleViewPath">
                            <td class="nodeName">&nbsp;</td>
                            <td class="nodeName">@childDepth1.NodeName</td>
                            <td class="nodeName"></td>
                            <td class="linkUrl">@Power.ToHtml(childDepth1Link)</td>
                            <td class="nodeType">@if(childDepth1.NodeType==0){<span>内容</span>}else if(childDepth1.NodeType==NodeType.Single){<span>单页</span>}else if(childDepth1.NodeType==NodeType.Link){<span>链接</span>}else if(childDepth1.NodeType==NodeType.Reference){<span>引用</span>}else{@childDepth1.NodeType}</td>
                            <td class="nodeModel">@if(childDepth1.MoldId==1){<span>文章</span>}else if(childDepth1.MoldId==2){<span>图片</span>}else if(childDepth1.MoldId==3){<span>视频</span>}else if(childDepth1.MoldId==4){<span>友情链接</span>}else if(childDepth1.MoldId==5){<span>领导信息</span>}else if(childDepth1.MoldId==6){<span>报告</span>}else{<span>@childDepth1.MoldId</span>}</td>
                            <td class="viewPath">@childDepth1.ListHomeViewPath</td>
                            <td class="viewPath">@childDepth1.ListViewPath</td>
                            <td class="viewPath">@childDepth1.ContentViewPath</td>
                            <td class="viewPath">@childDepth1.SingleViewPath</td>
                        </tr>
                        foreach (var childDepth2 in childDepth1.Children.Where(n => n.ShowOnMap))
                        {
                            var childDepth2Link ="";
                            if( childDepth2.NodeType == NodeType.Link){
                                if(string.IsNullOrEmpty(childDepth2.LinkUrl)){
                                    childDepth2Link = "空链接" ;
                                }
                                else if( childDepth2.LinkUrl.StartsWith("http") ){
                                    childDepth2Link = "外链接";
                                }
                                else if( childDepth2.LinkUrl.Contains("SiteUrl:") ){
                                    childDepth2Link ="<a target='_blank' href='"+ childDepth2.LinkUrl.ToUrl() +"'>"+ childDepth2.LinkUrl.ToUrl() +"</a>";
                                }else{
                                    childDepth2Link ="<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + childDepth2.LinkUrl.ToUrl() +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + childDepth2.LinkUrl.ToUrl() +"</a>";
                                }
                            }else{
                                childDepth2Link ="<a target='_blank' href='"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(childDepth2) +"'>"+ Power.Url.SiteUrl(child.Site.Subdomain) + Power.Url.NodeUrl(childDepth2) +"</a>";
                            }
                            <tr class="tr3" title="站点ID：@childDepth2.SiteId &#xD;节点ID：@childDepth2.NodeId &#xD;标识符：@childDepth2.Identifier &#xD;节点类型：@childDepth2.NodeType &#xD;节点模型：@childDepth2.MoldId &#xD;首页模板：@childDepth2.ListHomeViewPath &#xD;列表模板：@childDepth2.ListViewPath &#xD;内容模板：@childDepth2.ContentViewPath &#xD;单页模板：@childDepth2.SingleViewPath">
                                <td class="nodeName">&nbsp;</td>
                                <td class="nodeName">&nbsp;</td>
                                <td class="nodeName">@childDepth2.NodeName</td>
                                <td class="linkUrl">@Power.ToHtml(childDepth2Link)</td>
                                <td class="nodeType">@if(childDepth2.NodeType==0){<span>内容</span>}else if(childDepth2.NodeType==NodeType.Single){<span>单页</span>}else if(childDepth2.NodeType==NodeType.Link){<span>链接</span>}else if(childDepth2.NodeType==NodeType.Reference){<span>引用</span>}else{@childDepth2.NodeType}</td>
                                <td class="nodeModel">@if(childDepth2.MoldId==1){<span>文章</span>}else if(childDepth2.MoldId==2){<span>图片</span>}else if(childDepth2.MoldId==3){<span>视频</span>}else if(childDepth2.MoldId==4){<span>友情链接</span>}else if(childDepth2.MoldId==5){<span>领导信息</span>}else if(childDepth2.MoldId==6){<span>报告</span>}else{<span>@childDepth2.MoldId</span>}</td>
                                <td class="viewPath">@childDepth2.ListHomeViewPath</td>
                                <td class="viewPath">@childDepth2.ListViewPath</td>
                                <td class="viewPath">@childDepth2.ContentViewPath</td>
                                <td class="viewPath">@childDepth2.SingleViewPath</td>
                            </tr>
                        }
                    }
                }
            </table>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    $(".check-list .property .num b").html(($(".check-table tr").length)-1);//统计tr数量
    $(".check-table .linkUrl a").click(function(){
        $(this).parent().parent().addClass("active");//鼠标触发背景
    });
    // 批量打开站点链接
    $("#openUrl").click(function(){
        $(".check-table tr td.linkUrl a").each (function (){
            var openUrl = '';
            openUrl += window.open($(this).attr("href"));
        })
    });
</script>